/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.edu.flf.audioteca.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Nathan Azevedo
 */
@Embeddable
public class EmprestimoPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "id_usuario_fk")
    private int idUsuarioFk;
    @Basic(optional = false)
    @Column(name = "id_cd_fk")
    private int idCdFk;

    public EmprestimoPK() {
    }

    public EmprestimoPK(int idUsuarioFk, int idCdFk) {
        this.idUsuarioFk = idUsuarioFk;
        this.idCdFk = idCdFk;
    }

    public int getIdUsuarioFk() {
        return idUsuarioFk;
    }

    public void setIdUsuarioFk(int idUsuarioFk) {
        this.idUsuarioFk = idUsuarioFk;
    }

    public int getIdCdFk() {
        return idCdFk;
    }

    public void setIdCdFk(int idCdFk) {
        this.idCdFk = idCdFk;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idUsuarioFk;
        hash += (int) idCdFk;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EmprestimoPK)) {
            return false;
        }
        EmprestimoPK other = (EmprestimoPK) object;
        if (this.idUsuarioFk != other.idUsuarioFk) {
            return false;
        }
        if (this.idCdFk != other.idCdFk) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.edu.flf.audioteca.entidades.EmprestimoPK[idUsuarioFk=" + idUsuarioFk + ", idCdFk=" + idCdFk + "]";
    }

}
